package myTest.linckedList;

public class LinkedListMaker {

	public static Node getCycleList() {

		Node node1 = new Node("node1");
		Node node2 = new Node("node2");
		Node node3 = new Node("node3");
		Node node4 = new Node("node4");
		Node node5 = new Node("node5");
		Node node6 = new Node("node6");

		node1.next = node2;
		node2.next = node3;
		node3.next = node4;
		node4.next = node5;
		node5.next = node6;
		node6.next = node3;

		return node1;
	}

	public static Node[] getIntersectLists() {
		Node node1 = new Node("node1");
		Node node2 = new Node("node2");
		Node node3 = new Node("node3");
		Node node4 = new Node("node4");

		Node node33 = new Node("node33");
		Node node44 = new Node("node44");

		Node node5 = new Node("node5");
		Node node6 = new Node("node6");

		node1.next = node2;
		node2.next = node3;
		node3.next = node4;
		node4.next = node5;

		node33.next = node44;
		node44.next = node5;

		node5.next = node6;

		return new Node[] { node1, node33 };
	}

	public static Node getNormalLists() {
		Node node1 = new Node("node1");
		Node node2 = new Node("node2");
		Node node3 = new Node("node3");
		Node node4 = new Node("node4");
		Node node5 = new Node("node5");
		Node node6 = new Node("node6");

		node1.next = node2;
		node2.next = node3;
		node3.next = node4;
		node4.next = node5;
		node5.next = node6;

		return node1;
	}

}

class Node {
	public Node(String data) {
		this.data = data;
	}

	public Node next;
	public String data;

	@Override
	public String toString() {
		return "Node [data=" + data + "]";
	}

}
